export default {
  tab: {
    bind(el, { value }) {
      const _c = el.getElementsByClassName(value.className);

      const curIdxKey = Object.keys(value).filter(key => key !== 'className' || key !== 'activeClass')[0];
      _c[value[curIdxKey]].className += ` ${value.activeClass}`;
    },
    update(el, { value, oldValue }) {
      const _c = el.getElementsByClassName(value.className);

      const curIdxKey = Object.keys(value).filter(key => key !== 'className' || key !== 'activeClass')[0];
      const oldCurIdxKey = Object.keys(oldValue).filter(key => key !== 'className' || key !== 'activeClass')[0];
      _c[oldValue[oldCurIdxKey]].className = `${oldValue.className}`;
      _c[value[curIdxKey]].className += ` ${value.activeClass}`;
    }
  }
};
